<div class="pageContent">
	
	<form method="post" action="<?php echo Yii::app()->createUrl('order/edit');?>" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)">
		<input type="hidden" name="id" value="<?php echo $data['mainOrder']['order_id'];?>" />
		<div class="pageFormContent" layoutH="58">
			<!--主订单-->
			<div class="unit">
				<label>主订单号：</label>
				<p><?php echo $data['mainOrder']['order_sn'];?></p>
			</div>
			<div class="unit">
				<label>用户名称：</label>
				<input type="text" maxlength="30" class="required" errormsg="请输入用户名称" value="<?php echo $user['username'];?>" readonly="true"/>
			</div>
			<div class="unit">
				<label>订单金额：</label>
				<input type="text" name="dataForm[total_amount]" maxlength="30" class="number required" errormsg="请输入订单号" value="<?php echo $data['mainOrder']['total_amount'];?>"/>
			</div>
			<div class="unit">
				<label>订单状态：</label>
				<label><input type="radio" name="dataForm[order_status]" value="0" <?php if($data['mainOrder']['order_status'] == 0){?>checked<?php }?>/>有效</label>
				<label><input type="radio" name="dataForm[order_status]" value="1" <?php if($data['mainOrder']['order_status'] == 1){?>checked<?php }?>/>无效</label>
			</div>
			<div class="unit">
				<label>支付状态：</label>
				<label><input type="radio" name="dataForm[pay_status]" value="0" <?php if($data['mainOrder']['pay_status'] == 0){?>checked<?php }?>/>未支付</label>
				<label><input type="radio" name="dataForm[pay_status]" value="1" <?php if($data['mainOrder']['pay_status'] == 1){?>checked<?php }?>/>支付中</label>
				<label><input type="radio" name="dataForm[pay_status]" value="2" <?php if($data['mainOrder']['pay_status'] == 2){?>checked<?php }?>/>已支付</label>
				<label><input type="radio" name="dataForm[pay_status]" value="3" <?php if($data['mainOrder']['pay_status'] == 3){?>checked<?php }?>/>支付失败</label>
			</div>
			<div class="unit">
				<label>是否出游：</label>
				<label><input type="radio" name="dataForm[is_travel]" value="0" <?php if($data['mainOrder']['is_travel'] == 0){?>checked<?php }?>/>否</label>
				<label><input type="radio" name="dataForm[is_travel]" value="1" <?php if($data['mainOrder']['is_travel'] == 1){?>checked<?php }?>/>是</label>
			</div>
			<div class="unit">
				<label>预计出游时间：</label>
				<input type="text" name="dataForm[travel_date]" class="date required" size="30" errormsg="请输入预计出游时间" dateFmt="yyyy-MM-dd HH:mm:ss" readonly="true" value="<?php echo $data['mainOrder']['travel_date'];?>"/><a class="inputDateButton" href="javascript:;">选择</a>
			</div>
			<div class="unit">
				<label>下单时间：</label>
				<input type="text" name="dataForm[order_date]" class="date required" size="30" errormsg="请输入下单时间" dateFmt="yyyy-MM-dd HH:mm:ss" readonly="true" value="<?php echo $data['mainOrder']['order_date'];?>"/><a class="inputDateButton" href="javascript:;">选择</a>
			</div>
			<div class="unit">
				<label>过期时间：</label>
				<input type="text" name="dataForm[order_expire]" class="date required" size="30" errormsg="请输入过期时间" dateFmt="yyyy-MM-dd HH:mm:ss" readonly="true" value="<?php echo $data['mainOrder']['order_expire'];?>"/><a class="inputDateButton" href="javascript:;">选择</a>
			</div>
			<!--子订单-->
			<?php foreach($data['childOrder'] as $key=>$value){?>
			<div class="divider"></div>
			<input name="childForm[<?php echo $key;?>][order_detail_id]" value="<?php echo $value['order_detail_id'];?>" type="hidden"/>
			<div class="unit">
				<label>子订单号：</label>
				<p><?php echo $value['order_detail_sn'];?></p>
			</div>
			<div class="unit">
				<label>子订单商品名称：</label>
				<select class="combox" name="childForm[<?php echo $key;?>][goods_sn]">
					<?php foreach($goodsList as $v){?>
					<option value="<?php echo $v['goods_sn'];?>" <?php if($v['goods_sn'] == $value['goods_sn']){?>selected<?php }?>><?php echo $v['goods_name'];?></option>
					<?php }?>
				</select>
			</div>
			<div class="unit">
				<label>子订单购买份数：</label>
				<input type="text" name="childForm[<?php echo $key;?>][sell_num]" maxlength="30" class="digits required" errormsg="请输入购买份数" value="<?php echo $value['sell_num'];?>"/>
			</div>
			<div class="unit">
				<label>子订单商品单价：</label>
				<input type="text" name="childForm[<?php echo $key;?>][price]" maxlength="30" class="number required" errormsg="请输入商品单价" value="<?php echo $value['price'];?>"/>
			</div>
			<div class="unit">
				<label>子订单金额：</label>
				<input type="text" name="childForm[<?php echo $key;?>][total_price]" maxlength="30" class="number required" errormsg="请输入子订单金额" value="<?php echo $value['total_price'];?>"/>
			</div>
			<div class="unit">
				<label>子订单状态：</label>
				<label><input type="radio" name="childForm[<?php echo $key;?>][detail_status]" value="0" <?php if($value['detail_status'] == 0){?>checked<?php }?>/>有效</label>
				<label><input type="radio" name="childForm[<?php echo $key;?>][detail_status]" value="1" <?php if($value['detail_status'] == 1){?>checked<?php }?>/>无效</label>
			</div>
			<div class="unit">
				<label>子订单支付状态：</label>
				<label><input type="radio" name="childForm[<?php echo $key;?>][pay_status]" value="0" <?php if($value['pay_status'] == 0){?>checked<?php }?>/>未支付</label>
				<label><input type="radio" name="childForm[<?php echo $key;?>][pay_status]" value="1" <?php if($value['pay_status'] == 1){?>checked<?php }?>/>支付中</label>
				<label><input type="radio" name="childForm[<?php echo $key;?>][pay_status]" value="2" <?php if($value['pay_status'] == 2){?>checked<?php }?>/>已支付</label>
				<label><input type="radio" name="childForm[<?php echo $key;?>][pay_status]" value="3" <?php if($value['pay_status'] == 3){?>checked<?php }?>/>支付失败</label>
			</div>
			<?php }?>
		</div>
		<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li>
			</ul>
		</div>
	</form>
	
</div>